/*
 * 文件名：ExhibitionVoDaoImpl.java
 * 版权：Copyright 2007-2016 517na Tech. Co. Ltd. All Rights Reserved. 
 * 描述： ExhibitionVoDaoImpl.java
 * 修改人：yanshu
 * 修改时间：2016年1月26日
 * 修改内容：新增
 */
package com.feichuang.chineseWoodCarving.dao.impl;

import java.util.List;

import org.springframework.stereotype.Component;

import com.feichuang.chineseWoodCarving.dao.IExhibitionVoDao;
import com.feichuang.chineseWoodCarving.model.MExhibitionVo;
import com.feichuang.chineseWoodCarving.model.MPagerRequestVo;
import com.feichuang.chineseWoodCarving.util.StringUtil;

/**
 * TODO 添加类的一句话简单描述.
 * <p>
 * TODO 详细描述
 * <p>
 * TODO 示例代码
 * 
 * <pre>
 * </pre>
 * 
 * @author yanshu
 */
@Component("exhibitionVoDao")
public class ExhibitionVoDaoImpl extends BaseDaoImpl implements IExhibitionVoDao {

    /**
     * {@inheritDoc}.
     */
    @Override
    public List<MExhibitionVo> selectMExhibitionVoForPage(MPagerRequestVo<MExhibitionVo> pageRequest) {
        // TODO Auto-generated method stub
        return this.sqlSession.selectList("com.feichuang.chineseWoodCarving.dao.IExhibitionVoDao.selectMExhibitionVoForPage", pageRequest);
    }

    /**
     * {@inheritDoc}.
     */
    @Override
    public int selectMExhibitionVoCount(MPagerRequestVo<MExhibitionVo> pageRequest) {
        // TODO Auto-generated method stub
        return this.sqlSession.selectOne("com.feichuang.chineseWoodCarving.dao.IExhibitionVoDao.selectMExhibitionVoCount");
    }

    /**
     * {@inheritDoc}.
     */
    @Override
    public boolean insertMExhibitionVo(MExhibitionVo exhibitionVo) {
        // TODO Auto-generated method stub
        this.sqlSession.insert("com.feichuang.chineseWoodCarving.dao.IExhibitionVoDao.insertMExhibitionVo", exhibitionVo);
        return true;
    }

    /**
     * {@inheritDoc}.
     */
    @Override
    public boolean updateMExhibitionVo(MExhibitionVo exhibitionVo) {
        // TODO Auto-generated method stub
        this.sqlSession.update("com.feichuang.chineseWoodCarving.dao.IExhibitionVoDao.updateMExhibitionVo", exhibitionVo);
        return true;
    }

    /**
     * {@inheritDoc}.
     */
    @Override
    public boolean deleteMExhibitionVo(MExhibitionVo exhibitionVo) {
        // TODO Auto-generated method stub
        if (StringUtil.strIsNullOrEmpty(exhibitionVo.getKeyId())) {
            return false;
        }
        this.sqlSession.update("com.feichuang.chineseWoodCarving.dao.IExhibitionVoDao.deleteMExhibitionVo", exhibitionVo);
        return true;
    }
}
